{% extends "base.html" %}
{% load bootstrap3 %}

{% block title %}Password reset{% endblock %}

{% block content %}
<div class="container">
  <div class="row">
    <div class="col-sm-offset-2 col-sm-10">
      <h1>Password reset</h1>
    </div>
  </div>

{% if validlink %}
  <form action="" method="post" role="form" class="form-horizontal">
    {% csrf_token %}
    {% bootstrap_form form layout='horizontal' %}

    {% buttons %}
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-primary">
        Change password
      </button>
    </div>
    {% endbuttons %}
  </form>

{% else %}

  <div class="row">
    <div class="alert alert-danger col-sm-offset-2 col-sm-6">
      <p class="lead"><strong>Password reset failed!</strong></p>
    </div>
  </div>
  <div class="row">
    <div class="col-sm-offset-1 col-sm-10">
      <p class="lead">The password reset link was invalid, 
        possibly because it has already been used.</p>
      <p><a href="{% url 'django.contrib.auth.views.login' %}">Sign in</a>
    </div>
  </div>

{% endif %}

</div>
{% endblock %}
